package com.shilan.dllo.wangyi.fragment;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.shilan.dllo.wangyi.R;

/**
 * Created by dllo on 15/10/22.
 */
public class VaFragment extends Fragment {

    private RequestQueue queue;
    private RecyclerView vaView;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
       View view = inflater.inflate(R.layout.activity_va,null);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView();
    }

    private void initView(){
        queue = Volley.newRequestQueue(getContext());
        vaView = (RecyclerView) getActivity().findViewById(R.id.vaView);
        //加载布局 显示view有几列
        GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(),1);
        vaView.setLayoutManager(gridLayoutManager);
}
}
